﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeCubicSplineCurve3d : OdGeSplineEnt3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeCubicSplineCurve3d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeCubicSplineCurve3d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeCubicSplineCurve3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeCubicSplineCurve3d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeCubicSplineCurve3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeCubicSplineCurve3d() : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGeCubicSplineCurve3d source) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_1(OdGeCubicSplineCurve3d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGePoint3dArray fitPnts, OdGeTol tol) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_2(OdGePoint3dArray.getCPtr(fitPnts), OdGeTol.getCPtr(tol)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGePoint3dArray fitPnts) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_3(OdGePoint3dArray.getCPtr(fitPnts)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGePoint3dArray fitPnts, OdGeVector3d startDeriv, OdGeVector3d endDeriv, OdGeTol tol) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_4(OdGePoint3dArray.getCPtr(fitPnts), OdGeVector3d.getCPtr(startDeriv), OdGeVector3d.getCPtr(endDeriv), OdGeTol.getCPtr(tol)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGePoint3dArray fitPnts, OdGeVector3d startDeriv, OdGeVector3d endDeriv) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_5(OdGePoint3dArray.getCPtr(fitPnts), OdGeVector3d.getCPtr(startDeriv), OdGeVector3d.getCPtr(endDeriv)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGeCurve3d curve, double epsilon) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_6(OdGeCurve3d.getCPtr(curve), epsilon), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGeKnotVector knots, OdGePoint3dArray fitPnts, OdGeVector3dArray firstDerivs, bool isPeriodic) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_7(OdGeKnotVector.getCPtr(knots), OdGePoint3dArray.getCPtr(fitPnts), OdGeVector3dArray.getCPtr(firstDerivs), isPeriodic), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCubicSplineCurve3d(OdGeKnotVector knots, OdGePoint3dArray fitPnts, OdGeVector3dArray firstDerivs) : this(GlobalsPINVOKE.new_OdGeCubicSplineCurve3d__SWIG_8(OdGeKnotVector.getCPtr(knots), OdGePoint3dArray.getCPtr(fitPnts), OdGeVector3dArray.getCPtr(firstDerivs)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int numFitPoints()
		{
			int result = GlobalsPINVOKE.OdGeCubicSplineCurve3d_numFitPoints(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d fitPointAt(int fotPointIndex)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeCubicSplineCurve3d_fitPointAt(this.swigCPtr, fotPointIndex), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCubicSplineCurve3d setFitPointAt(int fitPointIndex, OdGePoint3d point)
		{
			OdGeCubicSplineCurve3d result = new OdGeCubicSplineCurve3d(GlobalsPINVOKE.OdGeCubicSplineCurve3d_setFitPointAt(this.swigCPtr, fitPointIndex, OdGePoint3d.getCPtr(point)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d firstDerivAt(int fitPointIndex)
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeCubicSplineCurve3d_firstDerivAt(this.swigCPtr, fitPointIndex), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCubicSplineCurve3d setFirstDerivAt(int fitPointIndex, OdGeVector3d deriv)
		{
			OdGeCubicSplineCurve3d result = new OdGeCubicSplineCurve3d(GlobalsPINVOKE.OdGeCubicSplineCurve3d_setFirstDerivAt(this.swigCPtr, fitPointIndex, OdGeVector3d.getCPtr(deriv)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCubicSplineCurve3d Assign(OdGeCubicSplineCurve3d spline)
		{
			OdGeCubicSplineCurve3d result = new OdGeCubicSplineCurve3d(GlobalsPINVOKE.OdGeCubicSplineCurve3d_Assign(this.swigCPtr, OdGeCubicSplineCurve3d.getCPtr(spline)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
